package com.utils

import com.IModule
import java.nio.file.WatchEvent

object ModuleUtils : IModule {

    /**
     * 自定义的模块
     */
    val modules = mutableListOf<IModule>()

    override fun onLoadConfigBefore() {
        modules.forEach { it.onLoadConfigBefore() }
    }

    override fun onLoadConfigAfter() {
        modules.forEach { it.onLoadConfigAfter() }
    }

    override fun onAddWatchBefore() {
        modules.forEach { it.onAddWatchBefore() }
    }

    override fun onAddWatchAfter() {
        modules.forEach { it.onAddWatchAfter() }
    }

    override fun onExecuteEvent(event: WatchEvent<*>) {
        modules.forEach { it.onExecuteEvent(event) }
    }
}
